<?php

/**
* SVN FILE: $Id: fw24h.js 46 2008-10-30 07:52:17Z dungpt $
* 
*
* $Author: dungpt
* $Revision: 46 $
* $Date: 2008-10-30 14:52:17 +0700 (Thu, 30 Oct 2008) $
* $LastChangedBy: dungpt $
* $LastChangedDate: 2008-10-30 14:52:17 +0700 (Thu, 30 Oct 2008) $
* $URL: http://192.168.1.10/svn_code24h/js/fw24h.js $
*
*/

class FormHelper {
	var $form = array();
	function init( $form) {
		$this->form = $form;
		pre( $this->form);
	}
	
	function value( $name, $show=true) {
		$value = $this->form[$name]['value'];
		if( $show) {
			echo $value;
		}
		return $value;
	}
	
	function error( $name, $show=true) {
		$value = $this->form[$name]['error'];
		if( $show) {
			echo $value;
		}
		return $value;
	}
	
	function errorDisplay() {
		$string = '';
		foreach( $this->form as $value) {
			$string .= $value['error'].'<br>';
		}
		echo $string;
	}
}


